<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新闻列表</title>
   

    <!-- <style>
        .news-box {
            width: 600px;
            margin: auto;
        }

        .news-item {
            display: flex;
            height: 120px;
            padding: 20px 0;
            cursor: pointer;
        }

        .news-item-left {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding-right: 10px;
        }

        .news-item-left .title {
            font-size: 20px;
        }

        .news-item-left .info {
            color: #999999;
        }

        .news-item-left .info span {
            margin-right: 20px;
        }

        .news-item-right {
            width: 160px;
            height: 120px;
        }

        .news-item-right img {
            width: 100%;
            height: 100%;
        }
    </style> -->
</head>
<script src="./js/vue@3.5.13.js"></script>


<body>
    <div id="app">
        <h1 v-color="green">这是一个标题</h1>
        <h1 v-rapper="我是一个rapper"></h1>
    </div>
    <script>
        const { createApp } = Vue
        const app = createApp({
            setup(){ return { }    }
        })
        app.directive('color',{
            mounted(el,binding){
                el.style.color = binding.value
                }
        })
        app.directive('rap',{
            mounted(el,binding){
                el.innerText = binding.value
            }
        })
        app.moun("#app")
    </script>
</body>

</html>